package com.yueman.ptoolopenticket.ticket.mapper;


import com.yueman.ptoolopenticket.ticket.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface TicketUserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {
    public User findUserByUid(String uid);

    public User findUserByIdno(String IDno);

    @Query(nativeQuery = true,value = "update pt_user s set s.status=?2 where s.idno=?1")
    @Modifying
    @Transactional
    Integer UpdateUserstatus(String IDNo,int status);
}
